﻿// =====================================================================
//
//  This file is part of the Microsoft Dynamics CRM SDK code samples.
//
//  Copyright (C) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//
// =====================================================================
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using Microsoft.Xrm.Sdk.Temporary;

namespace Microsoft.Xrm.Sdk.Metadata
{
	[DataContract(Name = "SecurityPrivilegeMetadata", Namespace = Microsoft.Xrm.Sdk.XmlNamespaces.V5.Metadata)]
	public sealed class SecurityPrivilegeMetadata : IExtensibleDataObject
	{
		#region Fields
		private string _name;
		private Guid _privilegeId;
		private PrivilegeType _privilegeType;
		private bool _canBeBasic;
		private bool _canBeLocal;
		private bool _canBeDeep;
		private bool _canBeGlobal;
		#endregion

		#region Constructors
		internal SecurityPrivilegeMetadata()
		{
		}
		#endregion

		#region Properties
		[DataMember]
		public bool CanBeBasic
		{
			get { return this._canBeBasic; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._canBeBasic = value; }
		}

		[DataMember]
		public bool CanBeDeep
		{
			get { return this._canBeDeep; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._canBeDeep = value; }
		}

		[DataMember]
		public bool CanBeGlobal
		{
			get { return this._canBeGlobal; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._canBeGlobal = value; }
		}

		[DataMember]
		public bool CanBeLocal
		{
			get { return this._canBeLocal; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._canBeLocal = value; }
		}

		[DataMember]
		public string Name
		{
			get { return this._name; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._name = value; }
		}

		[DataMember]
		public Guid PrivilegeId
		{
			get { return this._privilegeId; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._privilegeId = value; }
		}

		[DataMember]
		public PrivilegeType PrivilegeType
		{
			get { return this._privilegeType; }
			[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called via reflection")]
			internal set { this._privilegeType = value; }
		}
		#endregion

		#region IExtensibleDataObject Implementation
		private ExtensionDataObject ExtensionDataObject;
		public ExtensionDataObject ExtensionData
		{
			get
			{
				return ExtensionDataObject;
			}
			set
			{
				ExtensionDataObject = value;
			}
		}
		#endregion IExtensibleDataObject Implementation
	}
}
